﻿# group = this is the law_group a law belongs to
# icon = graphical icon shown in-game
# modifier = {} modifier on country for having adopted this law
# cultural_acceptance_rule and religious_acceptance_rule are triggers in the pop scope used to check if a pop should be accepted or discriminated against

law_state_religion = {
	group = lawgroup_church_and_state
	
	icon = "gfx/interface/icons/law_icons/state_religion.dds"
	
	progressiveness = -50
	
	on_enact = {
		recalculate_pop_ig_support = yes

		if = {
			limit = {
				any_scope_state = {
					has_modifier = jizya_state
				}
			}
			custom_tooltip = {
				text = jizya_remove_tt
				every_scope_state = {
					limit = {
						has_modifier = jizya_state
					}
					remove_modifier = jizya_state
				}
			}
		}
	}
	
	religious_acceptance_rule = {
		is_state_religion = scope:country
	}
	
	modifier = {
		interest_group_ig_devout_pol_str_mult = 0.3
		state_radicals_from_sol_change_accepted_religion_mult = -0.15
		state_loyalists_from_sol_change_accepted_religion_mult = 0.15	
		country_authority_add = 200
	}
	
	possible_political_movements = {
		law_freedom_of_conscience
	}

	pop_support = {
		value = 0
		# Clergy like theocracy
		add = {
			desc = "POP_CLERGYMEN"
			value = 0.5
		}
	}
	
	ai_will_do = {
		exists = ruler
		ruler = {
			has_ideology = ideology_theocrat
		}
	}
}
 
law_jizya = {
	group = lawgroup_church_and_state
	
	icon = "gfx/interface/icons/law_icons/religious_tax.dds"
	
	progressiveness = -30
	
	can_enact = {
		religion = {
			has_discrimination_trait = muslim
		}
	}
	
	is_visible = {
		religion = {
			has_discrimination_trait = muslim
		}
	}

	on_enact = {
		recalculate_pop_ig_support = yes

		custom_tooltip = {
			text = jizya_add_tt

			every_scope_state = {
				limit = {
					any_scope_pop = {
						state = { save_temporary_scope_as = m_state }
	
						culture = { 
							has_homeland = scope:m_state
							NOT = { is_primary_culture_of = root }
							NOT = { 
								#Check for muslim cultures to identify muslims,
								#until I can figure out how to find majority religions of cultures.
								OR = { 
									has_discrimination_trait = middle_eastern_heritage
									has_discrimination_trait = malay
									has_discrimination_trait = iranian_turanian_culture_group
									has_discrimination_trait = albanian_language
									has_discrimination_trait = arab_speaking
								}
							}
						}
						#These muslim cultures don't fit into any specific trait group and need to be pointed out specifically
						NOT = { 
							OR = {
							culture = cu:bosniak
							culture = cu:tatar
							culture = cu:fur
							culture = cu:swahili
							culture = cu:beja
							culture = cu:afar
							culture = cu:hausa
							culture = cu:fulbe
							culture = cu:dyula
							culture = cu:haratin
							culture = cu:mande
							culture = cu:maures
							culture = cu:songhai
							culture = cu:tuareg
							culture = cu:wolof
							}
						}
	
						religion = {
							NOT = { has_discrimination_trait = muslim }
						}
					}
				}
				add_modifier = {
					name = jizya_state
				}
			}
		}

	}
	
	religious_acceptance_rule = {
		custom_tooltip = {
			text = denominational_exclusion_tt
			shares_heritage_trait_with_state_religion = scope:country
		}
	}
	
	possible_political_movements = {
		law_freedom_of_conscience
		law_total_separation
	}
	
	
	modifier = {
		interest_group_ig_devout_pol_str_mult = 0.2
		state_radicals_from_sol_change_accepted_religion_mult = -0.1
		state_loyalists_from_sol_change_accepted_religion_mult = 0.1
	}

	pop_support = {
		value = 0
		add = {
			desc = "POP_CLERGYMEN"
			value = 0.5
		}
		add = {
			desc = "POP_DISCRIMINATED"		
			if = {
				limit = { 
					religion_accepted = no
				}
				add = 0.5		

				if = {
					limit = { 
						standard_of_living <= 10
					}
					add = 0.5
				}				
			}			
		}
	}
	
}

law_denominational_exclusion = {
	group = lawgroup_church_and_state
	
	icon = "gfx/interface/icons/law_icons/cultural_exclusion.dds"
	
	progressiveness = 0

	unlocking_technologies = {
		rationalism
	}

	disallowing_laws = {
		law_theocracy
	}
	
	on_enact = {
		recalculate_pop_ig_support = yes

		if = {
			limit = {
				any_scope_state = {
					has_modifier = jizya_state
				}
			}
			custom_tooltip = {
				text = jizya_remove_tt
				every_scope_state = {
					limit = {
						has_modifier = jizya_state
					}
					remove_modifier = jizya_state
				}
			}
		}
	}
	
	religious_acceptance_rule = {
		custom_tooltip = {
			text = denominational_exclusion_tt
			shares_heritage_trait_with_state_religion = scope:country
		}
		
	}
	
	modifier = {
		interest_group_ig_devout_pol_str_mult = 0.2
		state_radicals_from_sol_change_accepted_religion_mult = -0.1
		state_loyalists_from_sol_change_accepted_religion_mult = 0.1	
		country_authority_add = 150
	}
	
	possible_political_movements = {
		law_total_separation
	}
	
	pop_support = {
		value = 0
		
		add = {
			desc = "POP_ACADEMICS"
			# Academics generally against religious persecution
			if = {
				limit = {
					owner = {
						NOT = { has_law = law_type:law_total_separation }
					}
					is_pop_type = academics
				}
				value = 0.25		
			}
		}
		add = {
			desc = "POP_DISCRIMINATED"
			if = {
				limit = { 
					religion_accepted = no
					owner = { NOT = { has_law = law_type:law_total_separation } }
				}
				add = 0.5

				if = {
					limit = { 
						standard_of_living <= 10
					}
					add = 0.5
				}
			}			
		}
	}
}

law_freedom_of_conscience = {
	group = lawgroup_church_and_state
	
	icon = "gfx/interface/icons/law_icons/freedom_of_conscience.dds"
	
	progressiveness = 0

	unlocking_technologies = {
		rationalism
	}

	disallowing_laws = {
		law_theocracy
	}
	
	on_enact = {
		recalculate_pop_ig_support = yes

		if = {
			limit = {
				any_scope_state = {
					has_modifier = jizya_state
				}
			}
			custom_tooltip = {
				text = jizya_remove_tt
				every_scope_state = {
					limit = {
						has_modifier = jizya_state
					}
					remove_modifier = jizya_state
				}
			}
		}


	}
	
	religious_acceptance_rule = {
		custom_tooltip = {
			text = freedom_of_conscience_tt
			shares_trait_with_state_religion = scope:country
		}
	}
	
	modifier = {
		interest_group_ig_devout_pol_str_mult = 0.15
		state_radicals_from_sol_change_accepted_religion_mult = -0.05
		state_loyalists_from_sol_change_accepted_religion_mult = 0.05	
		country_authority_add = 100
	}
	
	possible_political_movements = {
		law_total_separation
	}
	
	pop_support = {
		value = 0
		
		add = {
			desc = "POP_ACADEMICS"
			# Academics generally against religious persecution
			if = {
				limit = {
					owner = {
						NOT = { has_law = law_type:law_total_separation }
					}
					is_pop_type = academics
				}
				value = 0.25		
			}
		}
		add = {
			desc = "POP_DISCRIMINATED"
			if = {
				limit = { 
					religion_accepted = no
					owner = { NOT = { has_law = law_type:law_total_separation } }
				}
				add = 0.5

				if = {
					limit = { 
						standard_of_living <= 10
					}
					add = 0.5
				}
			}			
		}
	}
}

law_total_separation = {
	group = lawgroup_church_and_state
	
	icon = "gfx/interface/icons/law_icons/total_separation.dds"
	
	progressiveness = 50

	unlocking_technologies = {
		empiricism
	}

	disallowing_laws = {
		law_theocracy
	}
	
	on_enact = {
		recalculate_pop_ig_support = yes

		if = {
			limit = {
				any_scope_state = {
					has_modifier = jizya_state
				}
			}
			custom_tooltip = {
				text = jizya_remove_tt
				every_scope_state = {
					limit = {
						has_modifier = jizya_state
					}
					remove_modifier = jizya_state
				}
			}
		}
	}
	
	religious_acceptance_rule = {
		always = yes
	}
	
	possible_political_movements = {
		law_freedom_of_conscience
	}
	
	pop_support = {
		value = 0
		
		add = {
			desc = "POP_ACADEMICS"
			# Academics generally against religious perseecution
			if = {
				limit = {
					is_pop_type = academics
				}
				value = 0.25	
			}
		}
		add = {
			desc = "POP_DISCRIMINATED"		
			if = {
				limit = { 
					is_pop_type = academics
				}
				add = 0.5		

				if = {
					limit = { 
						standard_of_living <= 10
					}
					add = 0.5
				}				
			}			
		}
	}
}